#include "Receptor.h"
#include "Fifo.h"

#define BUFFSIZE 100

Receptor::Receptor() {
	bytesLeidos = 0;
	lector = NULL;
	buffer = new char[BUFFSIZE];
}


Receptor::~Receptor() {
	delete[] buffer;
	if (lector)
		delete lector;
}
		

void Receptor::leer() {
	bytesLeidos = lector->leer(buffer, BUFFSIZE);
}

void Receptor::leer(int cantALeer) {
	bytesLeidos = lector->leer(buffer, cantALeer);
}
	
			
void Receptor::abrirCanalLectura(char* nombre) {
	lector = new Fifo(nombre);
}


void Receptor::cerrarCanalLectura() {
	lector->cerrar();
}
